package com.example.cms.controller;

import com.example.cms.entity.UserInfo;
import com.example.cms.pojo.BaseModel;
import com.example.cms.pojo.Mesagge;
import com.example.cms.pojo.QueryPage;
import com.example.cms.service.LoginLogService;
import com.wordnik.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @ClassName LoginLogController
 * @Descriptiom TODO
 * @Author Sunbird
 * @Date 2018/12/15 14:56
 * @Version 1.0
 **/
@RestController
public class LoginLogController  {

    HttpServletRequest request;
    HttpSession session;
    @Autowired
    private LoginLogService loginLogService;

    @RequestMapping("/selectPageLoginLog")
    public Mesagge selectPageLoginLog(Mesagge mesagge,QueryPage queryPage)throws Exception{
        loginLogService.selectLoginPage(queryPage,mesagge);
        return mesagge;
    }
//    @ApiOperation("查询个人的登录日志")
//    @RequestMapping("/selectPageMyLoginLog")
//    public BaseModel selectPageMyLoginLog(BaseModel baseModel)throws Exception{
//        UserInfo user=(UserInfo)request.getSession().getAttribute("userInfo");
//        baseModel.getQueryParams().setWhere("user_account="+user.getAccount());
//        loginLogService.selectPageLoginLog(baseModel);
//        return baseModel;
//    }
}
